package com.atguigu.eduservice.controller;

import com.atguigu.commonutils.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author zhaolie
 * @Date 2020/12/3 11:21 上午
 * @Version 1.0
 * @Description 讲师后台登录控制器
 */

@RestController
@RequestMapping("/eduservice/user")
@Api(description = "用户登录")
public class EduLoginController {

    // login
    @PostMapping("/login")
    @ApiOperation("用户登录")
    private Response login() {
        return Response.SUCCESS().data("token", "admin");
    }

    // info
    @GetMapping("/info")
    @ApiOperation("用户信息")
    private Response info() {
        Map map = new HashMap();
        map.put("roles", "[admin]");
        map.put("name", "admin");
        map.put("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        return Response.SUCCESS().data(map);
    }
}
